package com.jxnd.sunflower.config;

import com.jxnd.sunflower.common.JSONResult;
import com.jxnd.sunflower.exception.SunFlowerException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author: 敷衍
 * @description:
 * @date: 2021/12/4 14:01
 * @version: 1.0
 */
@RestControllerAdvice
public class JsonExceptionHandler {

    @ExceptionHandler(value = SunFlowerException.class)
    public JSONResult RoseException(Exception e){
        return new JSONResult(300,"异常",e.getMessage());
    }
}
